package com.acme.testing;

import java.util.ArrayList;
import java.util.Collection;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

public class TestUserDetails implements UserDetails {
    private static final long serialVersionUID = 1L;

    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
	Collection<GrantedAuthority> auths = new ArrayList<GrantedAuthority>();
	auths.add(new SimpleGrantedAuthority("ROLE_USER"));
	auths.add(new SimpleGrantedAuthority("ROLE_ADMIN"));
	return auths;
    }

    @Override
    public String getPassword() {
	return "password";
    }

    @Override
    public String getUsername() {
	return "user";
    }

    @Override
    public boolean isAccountNonExpired() {
	return true;
    }

    @Override
    public boolean isAccountNonLocked() {
	return true;
    }

    @Override
    public boolean isCredentialsNonExpired() {
	return true;
    }

    @Override
    public boolean isEnabled() {
	return true;
    }
}
